package cn.wolfcode.car.domain;

import cn.wolfcode.car.enumpkg.ConsumptionStatusEnum;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class Consumption {
    private Long id;

    private String cno;

    private Integer status;

    private BigDecimal totalAmount;

    private BigDecimal payAmount;

    private BigDecimal discountAmount;

    private String info;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date payTime;

    // private Long payeeId;
    private Employee payee;

    private String customerName;

    private String customerTel;

    private String carLicence;

    private String carType;

    private String appointmentAno;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date checkinTime;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date checkoutTime;

    //private Long businessId;\
    private Business business;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    private Long createUserId;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date auditTime;

    //private Long auditorId;
    private Employee auditor;


    public String getStatusName() {
        return ConsumptionStatusEnum.findName(this.status);
    }
}